package morenoapp.components.workplace;

import morenoapp.util.I18N;

/**
 * Steps of sociomaetrics research.
 * @author dmitry.mamonov
 */
public enum WorkplaceView {
    WelcomeView("creat_new_research"),
    ResearchView("configure_research"),
    //ConfigView("input_respondents_list"),
    InputView("input_poll_resilts"),
    SociomatrixView("sociomatrix"),
    SociogramView("sociogram"),
    ConclutionView("conclusion");
    String resourceKey;

    private WorkplaceView(String resourceKey) {
        this.resourceKey = resourceKey;
    }

    public WorkplaceView prev(){
        if (ordinal()>0){
            return values()[ordinal()-1];
        } else {
            return null;
        }
    }

    public WorkplaceView next(){
        if (ordinal()+1<values().length){
            return values()[ordinal()+1];
        } else {
            return null;
        }
    }

    public String getCaption() {
        return I18N.get("workspace_view.caption."+resourceKey);
    }

    public String getHelp(){
        return I18N.getResource("help_view_"+resourceKey+".html");
    }

    @Override
    public String toString() {
        return getCaption();
    }
}
